#include <stdio.h>
#include <stdlib.h>

const int privateNumber = 9;
int attemptNum;
const int attemptLim = 3;
int userGuess;

int main() {

	printf("number guessing game(1-15) - you have 3 attempts unless you modify the code\n\n");
	char startChoice;
	printf("Would you like to start this game [y/n] ");
	scanf("%c", &startChoice);

	if(startChoice == 'y') {
		while(userGuess != privateNumber) {
			printf("guess: ");
			scanf("%d", &userGuess);
			attemptNum++;
			if(userGuess == privateNumber) {
				printf("you win\n");
			} else if(userGuess != privateNumber && attemptNum >= attemptLim) {
				printf("you lose\n");
				return -1;
			}
		}
	} else {
		printf("bre\n");
	}		

}